package com.steak.javase.cglib;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * 功能说明：
 * <p>
 * Original @Author: steakliu-刘牌, 2022-10-09  10:04
 * <p>
 * Copyright (C)2020-2022  steakliu All rights reserved.
 */
public class ClassTest {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 10; i++) {
            Class<DemoService> serviceClass = DemoService.class;
            Method classMethod = serviceClass.getMethod("say", String.class);
            DemoService demoService = new DemoService();
            Object o = classMethod.invoke(demoService, "mikey");
            System.out.println(o);
        }
        long end = System.currentTimeMillis();
        System.out.println("Class cost time " + (end - start));
    }
}
